import type { RowType } from '#/views/quartz/qrtzJobLog/qrtzJobLog.data';

import { requestClient } from '#/api/request';

export namespace QrtzJobLogTableApi {
  export type RowTypeFetchParams = RowType;
  export interface IdFetchParams {
    id: string;
  }
  export interface ListFetchParams {
    [key: string]: any;
  }
  export interface PageListFetchParams {
    [key: string]: any;
    pageNo: number;
    pageSize: number;
  }
}

/**
 * 分页列表查询
 */
export async function qrtzJobLogQueryPageListApi(
  params: QrtzJobLogTableApi.PageListFetchParams,
) {
  return requestClient.get('/quartz/qrtzJobLog/queryPageList', { params });
}

/**
 * 列表查询
 */
export async function qrtzJobLogQueryListApi(
  params: QrtzJobLogTableApi.ListFetchParams,
) {
  return requestClient.get('/quartz/qrtzJobLog/queryList', { params });
}

/**
 * 通过ID查询
 * @param params
 */
export async function qrtzJobLogQueryByIdApi(
  params: QrtzJobLogTableApi.IdFetchParams,
) {
  return requestClient.get('/quartz/qrtzJobLog/queryById', { params });
}

/**
 * 新增
 */
export async function qrtzJobLogAddApi(
  params: QrtzJobLogTableApi.RowTypeFetchParams,
) {
  return requestClient.post('/quartz/qrtzJobLog/add', params);
}

/**
 * 编辑
 */
export async function qrtzJobLogEditApi(
  params: QrtzJobLogTableApi.RowTypeFetchParams,
) {
  return requestClient.post('/quartz/qrtzJobLog/edit', params);
}

/**
 * 删除
 * @param id 主键
 */
export async function qrtzJobLogDelApi(id) {
  return requestClient.delete<boolean>(`/quartz/qrtzJobLog/delete/${id}`);
}

/**
 * 批量删除删除
 * @param ids 主键
 */
export async function qrtzJobLogDeleteBatchApi(ids) {
  return requestClient.delete<boolean>(
    `/quartz/qrtzJobLog/deleteBatchByIds/${ids}`,
  );
}
